class Solution {
public:
    int smallestNumber(int n) {
        
        int nRet=1;
        while(nRet<n){
            nRet=(nRet<<1)|1;
        }

        return nRet;
    }
};
